package main

import (
	"fmt"
	"unsafe"
)

func main() {
	fmt.Print("test sizeof in golang\n")
	var a int
	var b byte
	var c string
	var d []int

	a = 1
	b = 'a'
	c = "hello"
	d = make([]int, 3)
	for i := 0; i < 3; i++ {
		d[i] = i
	}
	// 检查 是否 有\0
	fmt.Printf("检查", d[2])

	fmt.Println("int size", unsafe.Sizeof(a))
	fmt.Println("byte size", unsafe.Sizeof(b))
	fmt.Println("string size", unsafe.Sizeof(c))
	fmt.Println("array size", unsafe.Sizeof(d))
}
